#ifndef ADDNOTE_H
#define ADDNOTE_H

#include <head/g_pch.h>
#include <head/m_message.h>
#include "m_fhs.h"

namespace Ui {
class AddNote;
}

class AddNote : public QDialog
{
    Q_OBJECT

public:
    explicit AddNote(QWidget *parent,
                     const QStringList &categories);
    ~AddNote();

    void setCategory(const QString &category);

    void setItem(int id,
                 const QString &category,
                 const QString &label,
                 const QString &detail,
                 const QString &addition);

signals:
    void addItem(const QJsonObject &obj);
    void updateItem(const QJsonObject &obj);


private slots:
    void on_categories_currentTextChanged(const QString &category);

    void on_btn_submit_clicked();

private:
    Ui::AddNote *ui;

    int _id;
    QString _category,_label;
    QString _detail,_addition;
};

#endif // ADDNOTE_H
